import {userGetUserLevelList}from '@/api/rules/listdata.js'
export default {
    data() {
      return {
        // VIP等级
        VIPGradeList:[]
      }
    },
    
    computed: {
    },
    
    created() {
        this.getVIPGradeList()
    },
    methods: {
        // vip等级
        async getVIPGradeList(){
            const res =await userGetUserLevelList()
            if(res.status == 200) this.VIPGradeList =  res.data || []
        },
         /**
             * 根据value获取label
             * @param value
             * @param optionKey
             * @param prop
             * @returns {string}
        */
         getOptionLabel(value, optionKey, prop = {
            value: 'value',
            label: 'label'
          }) {
            if (!value) return '-'
            return ((this[optionKey] || []).find(e => e[prop.value] == value) || {})[prop.label] || value
          },
        }
  }
  